//
//  ChatItemButton.m
//  Btpin
//
//  Created by Vic on 2019/4/15.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "ChatItemButton.h"

@implementation ChatItemButton

- (instancetype)initWithFrame:(CGRect)frame imageName:(NSString *)imageName text:(NSString *)text {
    self = [super initWithFrame:frame];
    if (self) {
        [self initUIWithImageName:imageName text:text];
    }
    return self;
}
- (void)initUIWithImageName:(NSString *)imageName text:(NSString *)text {
    self.backgroundColor = COLOR_OF_CLEAR;
    
    UIImage *image = [UIImage imageNamed:imageName];
    self.imgView = [UIToolsControl initImageViewWithFrame:CGRectMake(self.frame.size.width*0.5-image.size.width*0.5, 30*Scale-image.size.height*0.5, image.size.width, image.size.height) imageName:nil];
    self.imgView.image = image;
    self.imgView.userInteractionEnabled = NO;
    [self addSubview:self.imgView];
    
    UILabel *label = [UIToolsControl initLabelWithFrame:CGRectMake(0, 40*Scale, self.frame.size.width, 33*Scale) text:text textColor:THEMECOLOR_OF_TEXT_666666 font:Font_15];
    label.userInteractionEnabled = NO;
    label.textAlignment = NSTextAlignmentCenter;
    label.backgroundColor = COLOR_OF_CLEAR;
    [self addSubview:label];
}

@end
